<?php
//包含数据库配置文件
include '../../public/dbconfig.php';
//包含函数库文件
include '../../public/functions.php';
//调用函数 链接数据库
$link = con();

//接收需要修改的帖子信息
//接收帖子id
$fid = $_POST['fid'];
//接收帖子标题
$title = $_POST['title'];
//接收内容
$content = $_POST['content'];

//准备修改语句
$sql = "update ftiezi set title='{$title}',content='{$content}' where id={$fid}";
//执行语句
$res = mysqli_query($link, $sql);
//判断执行结果
if($res){
	echo '<script>alert("修改成功");window.location.href="list.php";</script>';
}else{
	echo '<script>alert("修改失败");window.location.href="list.php";</script>';
}
//关闭数据链接
mysqli_close($link);
?>